Hide minor edits - Show changes to markup
textures/leucht/leucht
textures/leucht/leucht
{
qer_editorimage textures/leucht/leucht_blend.tga
surfaceparm nomarks
q3map_surfacelight 30000
qer_editorimage textures/leucht/leucht_blend.tga
surfaceparm nomarks
q3map_surfacelight 30000
{
map $lightmap
rgbGen identity
}
{
map textures/leucht/leucht.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/leucht/leucht_blend.tga
blendfunc GL_ONE GL_ONE
}
}
map $lightmap
rgbGen identity
}
{
map textures/leucht/leucht.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/leucht/leucht_blend.tga
blendfunc GL_ONE GL_ONE
}
}
while(1)
{
wait (randomfloat 2)
$fx_light_01 light 1 1 1 (randomfloat 100+300) //R(0-1) G(0-1) B(0-1) Radius
$fx_corona_01 show
wait (randomfloat 2)
$fx_light_01 light 1 1 1 0 //R(0-1) G(0-1) B(0-1) Radius
$fx_corona_01 hide
}
while(1)
{
wait (randomfloat 2)
$fx_light_01 light 1 1 1 (randomfloat 100+300) //R(0-1) G(0-1) B(0-1) Radius
$fx_corona_01 show
wait (randomfloat 2)
$fx_light_01 light 1 1 1 0 //R(0-1) G(0-1) B(0-1) Radius
$fx_corona_01 hide
}
This is basically a post I did in the .Map forun that got out of hand. It can be a good introduction to what lights are available in MOH:AA, and how they work.
This is basically a post I did in the .Map forum that got out of hand. It can be a good introduction to what lights are available in MOH:AA, and how they work.
This looks a bit more interesting than a flat ambientlight, right? :)
For this image I set up these three lights:
Red light
Another possibility to add light to your map would be to add a script_origin to your map and make it light in the script. This method has its pros and cons. The absolute pro is that you can switch on/off your light by script, even change it's brightness and color. The main disadvantage is, that this light isn't in the map during compilation, which means it doesn't know about walls and shines through them... Okay, if you don't care, here we go. Add a script_origin where you want the light to be (obviously). Give it
| light | 70 | The intensity of the light, default is 300 |
| _color | 1 0.2 0.2 | Light color components (RGB from 0 to 1) |
Orange light
| model | fx/dummy.tik | The model to use |
| targetname | fx_light_01 | its name in the script |
Add another script_origin where u want the corona to be. Without a corona, it would look quite strange, so don't forget it.
| light | 30 | The intensity of the light, default is 300 |
| _color | 1 0.5 0 | Light color components (RGB from 0 to 1) |
Spot light
| light | 70 | The intensity of the light, default is 300 |
| _color | 1 0.2 0.2 | Light color components (RGB from 0 to 1) |
Orange light
| Key | Value | Explanation |
|---|---|---|
| light | 30 | The intensity of the light, default is 300 |
| _color | 1 0.5 0 | Light color components (RGB from 0 to 1) |
Spot light
| Key | Value | Explanation |
|---|
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area the way u want...
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency in emitting light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area the way u want... In the pictures below, u can see to the left an original light emitting texture which gives the visual effect of light behind a window but which can't brighten the room. To the right, the small light post is illuminating the area just by its four custom light emitting surfaces. The used images are simple singlecoloured tgas, covering the possibility to have different images for use as the texture and the light emitting thing... Here, for example, the lamp looks rather white (the image leucht.tga) and gives yellowish light (image leucht_blend.tga). Additionally, I added a corona in the center of the lamp. The shader is a follows:
textures/leucht/leucht
{
qer_editorimage textures/leucht/leucht_blend.tga
surfaceparm nomarks
q3map_surfacelight 30000
{
map $lightmap
rgbGen identity
}
{
map textures/leucht/leucht.tga
blendFunc GL_DST_COLOR GL_ZERO
rgbGen identity
}
{
map textures/leucht/leucht_blend.tga
blendfunc GL_ONE GL_ONE
}
}
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area...
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area the way u want...
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face and that value in q3map_surfacelight (value). For small faces you might have to set this value to 10000 or even more, to make them light the area...
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face, the brightness of the image (how much of it is rather white than black) and that q3map_surfacelight (value) in the shader. For small faces you might have to set this value to 20000 or even more, to make them light the area...
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Hmmm... I thought these surfaces were acting as lights, but the image from a test compile below shows that the surfaces thnselves are light, but that they do not actually light up the surrounding area.
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Most light emitting surfaces coming with Moh:AA have a very low surfacelight value in their shader, so they seem to NOT light the surrounding area. Their actual efficiency as a light depends on the size of the face and that value in q3map_surfacelight (value). For small faces you might have to set this value to 10000 or even more, to make them light the area...
In the two images above I did actually rip off the celing to let some daylight in. Sun uses the values suncolor 70 70 70 and sundirection -42 45 0.
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights.
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights. Hmmm... I thought these surfaces were acting as lights, but the image from a test compile below shows that the surfaces thnselves are light, but that they do not actually light up the surrounding area.
For this image these I set up these lights:
For this image I set up these three lights:
| spot_angle | 67 | |
| target | spot_target | |
| spot_angle | 67 | Default is 45 |
| target | spot_target | spot_target is the targetname of a script_origin directly below the light entity |
In these two pictures, I made the point light into a spotlight by giving it a target directly below it ( to set where it is pointing ) and then setting spot_angle 65 ( the default is 45, but I wanted it a bit wider, because it looked better ). The second picture is compiled with the key lightdensity 4 in worldspawn.
This looks a bit more interesting than a flat ambientlight, right? :)
For this image these I set up these lights:
Red light
| Key | Value | Explanation |
|---|---|---|
| light | 70 | The intensity of the light, default is 300 |
| _color | 1 0.2 0.2 | Light color components (RGB from 0 to 1) |
Orange light
| Key | Value | Explanation |
|---|---|---|
| light | 30 | The intensity of the light, default is 300 |
| _color | 1 0.5 0 | Light color components (RGB from 0 to 1) |
Spot light
| Key | Value | Explanation |
|---|---|---|
| spot_angle | 67 | |
| target | spot_target | |
In the following two pictures, I use a standard point light and an ambientlight (ambientlight 10 10 10).
In the picture above I use all standard light settings. Way nicer than only using ambientlight, right?
In the picture above I have set the key lightdensity 4 in worldspawn. This means that the resolution of the shadows generated by the light compiler will be higher, creating more distinct shadows. This is generally not a good idea, as the light compile will be a LOT longer ( and some compiles may even fail because it cant handle the huge amounts of light data ).
But you dont have to set it for the entire map: you can just select some extra visible faces and do this:
As you see in the surface properties dialog? above, you can set the Density of a surface, giving it a sharper shadowing.
This image is a room lit only with the light: ambientlight 10 10 10. If you look at the large version of it, you may be able to see the stones. This or maby a bit higher is good for a map where you want some dark corners.
This second image is the same room lit only with the light: ambientlight 40 40 40. As you can see, it looks veeeery boring. This level is great if you want a map that looks like crap, or takes place in a very brightly lit area.
Still left to do: Add example pictures to tutorial.
This is basically a post I did in the .Map forun that got out of hand. It can be a good introduction to what lights are available in MOH:AA, and how they work.
(:toc:)
There are 3 basic light types:
This light is applied to everything in the entire map. This value dictates the absolute darkest there can be in a map. A sealed off room with no openings will have only this light.
Basically "lightbulbs". They radiate light equally in all directions from a singular point ( hence the name I guess ). A sealed off room with no openings and a point light will have this light + the ambient light.
As opposed to point light: this light is parallell to in a single direction ( an approximation of the light from the sun ( real sunlight is not paralell, but the few rays that reach us are pretty far from the sun, so considering it paralell vill be easier to compute and the human eye does not notice a difference ) ). A sealed off room with no openings Will have none of this light. But rip off the roof an it will probably get some ( if you have set the sunlight to come from above atleast... )
There are other lights that are really not separate light types. Rather they are lighting effects created out of the basic light types.
These are shaders that are made to emitt light from an entire surface. But what the compiler actually does under the hood is to create a number of point lights over the surface. So really it is just a shortcut for placing a lot of small point lights.
These are a specially configured point light (made to light up a cone from the point light source), its not really a type by itself. Think of it as a lightbulb at the bottom of a cone of some material that blocks light, creating a "light cone".
-- Bjarne